package com.jspgou.cms.entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the jc_balance table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="jc_balance"
 */

public abstract class BaseBalance  implements Serializable {

	public static String REF = "Balance";
	public static String PROP_PLAT_TOTAL = "platTotal";
	public static String PROP_STORE_TOTAL = "storeTotal";
	public static String PROP_COMMISSION = "commission";
	public static String PROP_STORE = "store";
	public static String PROP_ID = "Id";
	public static String PROP_END_TIME = "endTime";
	public static String PROP_START_TIME = "startTime";
	public static String PROP_TOTAL = "total";


	// constructors
	public BaseBalance () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseBalance (java.lang.Long id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseBalance (
		java.lang.Long id,
		com.jspgou.cms.entity.Store store,
		java.lang.Double commission,
		java.lang.Double storeTotal,
		java.lang.Double platTotal,
		java.lang.Double total,
		java.util.Date startTime,
		java.util.Date endTime) {

		this.setId(id);
		this.setStore(store);
		this.setCommission(commission);
		this.setStoreTotal(storeTotal);
		this.setPlatTotal(platTotal);
		this.setTotal(total);
		this.setStartTime(startTime);
		this.setEndTime(endTime);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Long id;

	// fields
	private java.lang.Double commission;
	private java.lang.Double storeTotal;
	private java.lang.Double platTotal;
	private java.lang.Double total;
	private java.util.Date startTime;
	private java.util.Date endTime;

	// many to one
	private com.jspgou.cms.entity.Store store;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="balance_id"
     */
	public java.lang.Long getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Long id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: commission
	 */
	public java.lang.Double getCommission () {
		return commission;
	}

	/**
	 * Set the value related to the column: commission
	 * @param commission the commission value
	 */
	public void setCommission (java.lang.Double commission) {
		this.commission = commission;
	}


	/**
	 * Return the value associated with the column: storeTotal
	 */
	public java.lang.Double getStoreTotal () {
		return storeTotal;
	}

	/**
	 * Set the value related to the column: storeTotal
	 * @param storeTotal the storeTotal value
	 */
	public void setStoreTotal (java.lang.Double storeTotal) {
		this.storeTotal = storeTotal;
	}


	/**
	 * Return the value associated with the column: platTotal
	 */
	public java.lang.Double getPlatTotal () {
		return platTotal;
	}

	/**
	 * Set the value related to the column: platTotal
	 * @param platTotal the platTotal value
	 */
	public void setPlatTotal (java.lang.Double platTotal) {
		this.platTotal = platTotal;
	}


	/**
	 * Return the value associated with the column: total
	 */
	public java.lang.Double getTotal () {
		return total;
	}

	/**
	 * Set the value related to the column: total
	 * @param total the total value
	 */
	public void setTotal (java.lang.Double total) {
		this.total = total;
	}


	/**
	 * Return the value associated with the column: startTime
	 */
	public java.util.Date getStartTime () {
		return startTime;
	}

	/**
	 * Set the value related to the column: startTime
	 * @param startTime the startTime value
	 */
	public void setStartTime (java.util.Date startTime) {
		this.startTime = startTime;
	}


	/**
	 * Return the value associated with the column: endTime
	 */
	public java.util.Date getEndTime () {
		return endTime;
	}

	/**
	 * Set the value related to the column: endTime
	 * @param endTime the endTime value
	 */
	public void setEndTime (java.util.Date endTime) {
		this.endTime = endTime;
	}


	/**
	 * Return the value associated with the column: store_id
	 */
	public com.jspgou.cms.entity.Store getStore () {
		return store;
	}

	/**
	 * Set the value related to the column: store_id
	 * @param store the store_id value
	 */
	public void setStore (com.jspgou.cms.entity.Store store) {
		this.store = store;
	}



	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jspgou.cms.entity.Balance)) return false;
		else {
			com.jspgou.cms.entity.Balance balance = (com.jspgou.cms.entity.Balance) obj;
			if (null == this.getId() || null == balance.getId()) return false;
			else return (this.getId().equals(balance.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}